//
// Created by lz on 2021/2/24.
//

#ifndef MYWEBLIB_BASE_EXCEPTION_H_
#define MYWEBLIB_BASE_EXCEPTION_H_

#include "base/Types.h"
#include <exception>

namespace lzweb
{
 class Exception : public std::exception
 {
  public:
 	Exception(string what);
 	// override 显式调用重写基类的同名函数
 	~Exception() noexcept override = default;

	 // default copy-ctor and operator= are okay.
	 const char* what() const noexcept override
	 {
	 	return message_.c_str();
	 }
	 const char* stackTrace() const	noexcept
	 {
	 	return stack_.c_str();
	 }


  private:
 	string message_;
  	string stack_;
 };
}//namespace lzweb


#endif //MYWEBLIB_BASE_EXCEPTION_H_
